|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnegotiator.issue.Objective
public class Objective
Some work needs to be done to guarantee consistency of the tree. Methods like setParent don't signal the parent that it has a new child yet. Also check the constructors for this... The whole code needs a review anyway, though with current use it works fine :-)
| Constructor Summary | |
|---|---|
Objective()
|
|
Objective(Objective parent)
|
|
Objective(Objective parent,
java.lang.String name)
|
|
Objective(Objective parent,
java.lang.String name,
int nr)
|
|
| Method Summary | |
|---|---|
void |
addChild(Objective newObjective)
Adds a child to this Objective. |
java.util.Enumeration<Objective> |
children()
|
boolean |
equalContents(Objective obj)
check the contents but don't check for the class type anymore. |
boolean |
equals(java.lang.Object o)
|
boolean |
getAllowsChildren()
|
Objective |
getChildAt(int childIndex)
|
int |
getChildCount()
|
java.util.ArrayList<Objective> |
getChildren()
Wouter: added bcause I dont have time to change all Vector and Enumerators to ArrayList code |
Objective |
getChildWithID(int ID)
|
java.lang.String |
getDescription()
|
int |
getHighestObjectiveNr(int lowerBound)
This method recursively calculates the highest Objective / Issue number in the subtree rooted at the callee. |
int |
getIndex(javax.swing.tree.TreeNode node)
|
java.lang.String |
getName()
|
int |
getNumber()
|
Objective |
getObjective(int objectiveNr)
This method does a recursive depth-first search on the subtree that is rooted at the receiver, and returns the first Objective or Issue with the given number. |
Objective |
getParent()
|
javax.swing.tree.TreePath |
getPath()
|
java.util.Enumeration<Objective> |
getPreorderEnumeration()
Constructs an Enumeration of the entire subtree of the receiver (including itself) in preorder. |
java.util.Enumeration<Objective> |
getPreorderIssueEnumeration()
Constructs an Enumeration of the entire subtree of the receiver (including itself) in preorder, containing only the Issues, but not the normal Objectives. |
java.util.Enumeration<Objective> |
getPreorderObjectiveEnumeration()
Constructs an Enumeration of the entire subtree of the receiver (including itself) in preorder, containting only the Ojectives, but not the Issues.. |
Objective[] |
getSiblings()
|
ISSUETYPE |
getType()
This method is added for convenience. |
java.lang.Object |
getUserObject()
|
int |
hashCode()
|
void |
insert(javax.swing.tree.MutableTreeNode child,
int index)
Adds child to the receiver at index. |
boolean |
isIssue()
|
boolean |
isLeaf()
|
boolean |
isObjective()
|
boolean |
isParent(Objective child)
Check whether or not a particular Objective is a child of the receiver. |
void |
remove(int index)
Removes the child at the given index, setting it's parent to null. |
void |
remove(javax.swing.tree.MutableTreeNode node)
Removes node from the receiver's children, and sets it's parent to null. |
void |
removeFromParent()
Removes the subtree rooted at this node from the tree, giving this node a null parent. |
void |
setDescription(java.lang.String newDescription)
Sets a new description for this node. |
void |
setName(java.lang.String newName)
Sets a new name for this node. |
void |
setNumber(int nr)
Sets the number of this Objective / Issue. |
void |
setParent(javax.swing.tree.MutableTreeNode newParent)
Sets this node's parent to newParent but does not change the parent's child array. |
void |
setUserObject(java.lang.Object object)
Sets a user object associated with the receiving Objective. |
java.lang.String |
toString()
|
negotiator.xml.SimpleElement |
toXML()
Returns an xml representation of this Objective and all Objectives and issues underneath it. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Objective()
public Objective(Objective parent)
public Objective(Objective parent,
java.lang.String name)
public Objective(Objective parent,
java.lang.String name,
int nr)
| Method Detail |
|---|
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic boolean equalContents(Objective obj)
obj - the objective to be compared
public java.lang.String getName()
public void setName(java.lang.String newName)
newName - the new name for this node.public int getNumber()
public void setNumber(int nr)
public java.lang.String getDescription()
public void setDescription(java.lang.String newDescription)
newDescription - the new description.public java.lang.Object getUserObject()
public boolean isObjective()
public boolean isIssue()
public ISSUETYPE getType()
public void addChild(Objective newObjective)
newObjective - a child to be added to this Objective.public Objective getObjective(int objectiveNr)
objectiveNr - the Objective/Issue number that is being searched for.
public java.lang.String toString()
toString in class java.lang.Objectpublic Objective[] getSiblings()
public boolean isParent(Objective child)
child - the potential child of the callee.
public java.util.Enumeration<Objective> children()
children in interface javax.swing.tree.TreeNodepublic java.util.ArrayList<Objective> getChildren()
public boolean getAllowsChildren()
getAllowsChildren in interface javax.swing.tree.TreeNodepublic Objective getChildAt(int childIndex)
getChildAt in interface javax.swing.tree.TreeNodepublic Objective getChildWithID(int ID)
ID - is the ID number of the needed child
public int getChildCount()
getChildCount in interface javax.swing.tree.TreeNodepublic int getIndex(javax.swing.tree.TreeNode node)
getIndex in interface javax.swing.tree.TreeNodepublic Objective getParent()
getParent in interface javax.swing.tree.TreeNodepublic boolean isLeaf()
isLeaf in interface javax.swing.tree.TreeNodepublic int getHighestObjectiveNr(int lowerBound)
lowerBound - the number to be returned must have at least this value. Used for the recursive implementation.
public void insert(javax.swing.tree.MutableTreeNode child,
int index)
insert in interface javax.swing.tree.MutableTreeNodechild - the Objective to be inserted. If child is no NegotionTreeNode, a ClassCastException will be
thrown.index - the index where the new node is to be inserted.public void remove(int index)
remove in interface javax.swing.tree.MutableTreeNodepublic void remove(javax.swing.tree.MutableTreeNode node)
remove in interface javax.swing.tree.MutableTreeNodepublic void removeFromParent()
removeFromParent in interface javax.swing.tree.MutableTreeNodepublic void setParent(javax.swing.tree.MutableTreeNode newParent)
setParent in interface javax.swing.tree.MutableTreeNodepublic void setUserObject(java.lang.Object object)
setUserObject in interface javax.swing.tree.MutableTreeNodepublic java.util.Enumeration<Objective> getPreorderEnumeration()
public java.util.Enumeration<Objective> getPreorderObjectiveEnumeration()
public java.util.Enumeration<Objective> getPreorderIssueEnumeration()
public negotiator.xml.SimpleElement toXML()
public javax.swing.tree.TreePath getPath()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||